<script type="text/javascript">
    {literal}
        $(document).ready(function() {
            $("#from").datepicker({ 
                dateFormat: "dd/mm/yy",
                firstDay: 1      
            });
            $(".float").change(function() {
                makeFloat(".float");
            });
        });
    {/literal}
</script>

<ul class="subNavig">
    <li><a href="{$data.root}?input=list_of_clients">Clients</a></li>
    <li><a href="{$data.root}?input=list_of_users">Users</a></li>
    <li><a href="{$data.root}?input=list_of_tariffs">Tariffs</a></li>
    <li><a href="{$data.root}?input=fixed_expense">Fixed expenses</a></li>
</ul>

<h2 class="pageTitle">Add expense</h2>

<form class="adding" action="{$data.root}?input=add_expense" method="post" onsubmit="return checkAdd_expense(
                                                                    $('#user').val(),
                                                                    $('#fixed_expense').val(),
                                                                    $('#from').val())
                                                                    ">
    <table class="tableForm">
        <tr>
            <td>
                <label for="user">User<span class="red"></span> </label>
            </td>
            <td>
                <select name="expense[userId]" size="1" id="user">
                    {foreach $data.users as $key => $user}
                        <option value="{$user.users_id}">{$user.surname}, {$user.name}</option>
                    {/foreach}
                </select>
            </td>
        </tr>
        <tr>
            <td>
                <label for="fixed_expense">Fixed expense<span class="red"></span> </label>
            </td>
            <td>
                <input class="float" name="expense[expense]" id="fixed_expense" type="text" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="from">From<span class="red"></span> </label>
            </td>
            <td>
                <input name="expense[from]" id="from" type="text" value="{$data.prefill.from}" />
            </td>
        </tr>
        <tr class="submitRow">
            <td>
                <input name="action" value="add_expense" type="hidden" />
            </td>
            <td>
                <input type="submit" value="Add expense" /> &nbsp; 
                <span class="red">* Required</span>
            </td>
            <td></td>
        </tr>
    </table>
</form>